#include <bits/stdc++.h>
using namespace std;

const int MAXN = 100010;
int h[MAXN], w[MAXN];
int n, k;

bool check(int d) {
    int num = 0;
    for (int i = 0; i < n; i++) 
        num += (h[i] / d) * (w[i] / d);
    if (num >= k) return true;
    else return false;
}

int main() {
    cin >> n >> k;
    for (int i = 0; i < n; i++) 
        cin >> h[i] >> w[i];
    int l = 1, r = MAXN;
    while (l <= r) {
        int mid = (l + r) / 2;
        if (check(mid))
            l = mid + 1;
        else 
            r = mid - 1;
    }
    cout << l - 1 << endl;
    return 0;

}